+++ /dev/null
-require "erb"
-
-def font(url, family, weight: weight, italic: italic)
- url = "../fonts/#{url}.woff"
-
- erb = ERB.new(<<-HERE.gsub(/^ /, ""), nil, "-")
- @font-face {
- src: url("#{url}");
- font-family: "<%= family %>";
- <%- if weight -%>
- font-weight: <%= weight %>;
- <%- end -%>
- <%- if italic -%>
- font-style: italic;
- <%- end -%>
- }
-
- HERE
-
- erb.result(binding)
-end
-
-File.open("source/stylesheets/fonts.css.scss", "w") do |file|
- file.puts font("Consolas", "Consolas")
- file.puts font("Consolas-Bold", "Consolas", weight: "bold")
- file.puts font("Consolas-Italic", "Consolas", italic: true)
- file.puts font("Consolas-Bold-Italic", "Consolas", weight: "bold", italic: true)
-
- file.puts font("Roboto/Roboto-Thin", "Roboto", weight: 100)
- file.puts font("Roboto/Roboto-Light", "Roboto", weight: 200)
- file.puts font("Roboto/Roboto-Regular", "Roboto", weight: 400)
- file.puts font("Roboto/Roboto-Medium", "Roboto", weight: 500)
- file.puts font("Roboto/Roboto-Bold", "Roboto", weight: 700)
- file.puts font("Roboto/Roboto-Black", "Roboto", weight: 800)
-end
@import "compass/css3";
-
-@include font-face("Consolas", inline-font-files("Consolas.woff", woff), $weight: 400);
-@include font-face("Consolas", inline-font-files("Consolas-Bold.woff", woff), $weight: 700);
-@include font-face("Roboto", inline-font-files("Roboto/Roboto-Regular.woff", woff), $weight: 400);
-@include font-face("Roboto", inline-font-files("Roboto/Roboto-Bold.woff", woff), $weight: 700);
-@include font-face("Roboto", inline-font-files("Roboto/Roboto-Medium.woff", woff), $weight: 500);
-
-@font-face {
- src: url("../fonts/Consolas-Italic.woff");
- font-family: "Consolas";
- font-style: italic;
-}
-
-@font-face {
- src: url("../fonts/Consolas-Bold-Italic.woff");
- font-family: "Consolas";
- font-weight: bold;
- font-style: italic;
-}
-
-@font-face {
- src: url("../fonts/Roboto/Roboto-Thin.woff");
- font-family: "Roboto";
- font-weight: 100;
-}
-
-@font-face {
- src: url("../fonts/Roboto/Roboto-Light.woff");
- font-family: "Roboto";
- font-weight: 200;
-}
-
-@font-face {
- src: url("../fonts/Roboto/Roboto-Black.woff");
- font-family: "Roboto";
- font-weight: 800;
-}
-
+++ /dev/null
-require "fileutils"
-
-FileUtils.rm Dir["source/fonts/**/*.woff"]
-
-Dir["source/fonts/**/*.ttf"].each do |file|
- out = file.sub(/\.ttf$/, ".woff").gsub(' ', "-")
- puts "Converting `#{file}` to `#{out}`"
- `~/npm/bin/ttf2woff "#{file}" "#{out}"`
-end